package com.info.zhiduoduo.repository.dto.maker;

import com.alibaba.excel.annotation.ExcelProperty;
import com.info.zhiduoduo.common.excelconverter.IntFlagConverter;
import com.info.zhiduoduo.common.excelconverter.TaxAcctStateConverter;

import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.BeanUtils;

import java.util.Date;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)  //setter return this;
@ToString
public class StudioBriefExportDto {

	@ExcelProperty("注册日期")
	private Date createtime;

	@ExcelProperty("更新日期")
	private Date updatetime;

	@ExcelProperty("姓名")
	private String realname;

	@ExcelProperty("身份证")
	private String idno;

	@ExcelProperty("手机号")
	private String phone;

	@ExcelProperty("工作室全名")
	private String username;

	@ExcelProperty("工作室昵称")
	private String studionickname;

	@ExcelProperty("经营范围")
	private String tradecategory;

	@ExcelProperty(value = "可开专票", converter = IntFlagConverter.class)
	private int specialinvoice;

	@ExcelProperty("发票内容")
	private String invoicescope;

	@ExcelProperty("交易企业")
	private String bindcompname;

	@ExcelProperty(value = "税务开户证明上传", converter = IntFlagConverter.class)
	private int hasTaxPhoto;

	@ExcelProperty(value = "税户状态", converter = TaxAcctStateConverter.class)
	private Integer taxAcctState;
	@ExcelProperty("统一信用码")
	private String creditcode;

	public static StudioBriefExportDto of(StudioBriefDto dto) {
		StudioBriefExportDto exportDto = new StudioBriefExportDto();
		BeanUtils.copyProperties(dto, exportDto);
		return exportDto;
	}
}
